﻿<controls:ChildWindow xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  x:Class="caedisi.Views.PartitionValidationReport"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                      xmlns:my="clr-namespace:caedisi.Views.Controls"  
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           Width="800" Height="600" 
           Title="PartitionValidation"
           DataContext="{Binding RelativeSource={RelativeSource Self}}"
                      >
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <sdk:Label Content="Some errors have been found" />

        <Grid Margin="2" Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <sdk:Label Content="Intersection Errors" Grid.Row="0"/>
            <ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" >
                <ListBox  x:Name="ListBoxIntersection" ItemsSource="{Binding Path=IntersectionErrors, Mode=TwoWay}"  HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel>
                                <sdk:Label Grid.Row="1" Grid.Column="0"   Content="Wrong interval..." HorizontalAlignment="Left"  Visibility="{Binding Path=IsIntersectionVisible, Mode=TwoWay}"/>
                                <sdk:Label Grid.Row="1" Grid.Column="0"   Content="Partition intersection error..." HorizontalAlignment="Left"  Visibility="{Binding Path=IsIntersectionVisible, Mode=TwoWay}"/>
                                <sdk:Label Grid.Row="1" Grid.Column="0"   Content="Right click the current CA cells to show coordinates..." HorizontalAlignment="Left"  Visibility="{Binding Path=IsIntersectionVisible, Mode=TwoWay}"/>
                                <sdk:Label Grid.Row="1" Grid.Column="0"   Content="Check partitioning..." HorizontalAlignment="Left"  Visibility="{Binding Path=IsIntersectionVisible, Mode=TwoWay}"/>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </ScrollViewer>
            <sdk:Label Content="Not Used Cells Errors" Grid.Row="2"/>
            <ScrollViewer Grid.Row="3" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" >
                <ListBox x:Name="ListBoxNotUsedCell" ItemsSource="{Binding Path=EmptyErrors, Mode=TwoWay}"  HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel>
                                <sdk:Label Grid.Row="1" Grid.Column="0"   Content="Wrong interval..." HorizontalAlignment="Left"  Visibility="{Binding Path=IsNotUsedVisible, Mode=TwoWay}"/>
                                <sdk:Label Grid.Row="1" Grid.Column="0"   Content="Some cells do not belong to any interval..." HorizontalAlignment="Left"  Visibility="{Binding Path=IsNotUsedVisible, Mode=TwoWay}"/>
                                <sdk:Label Grid.Row="1" Grid.Column="0"   Content="Right click the current CA cells to show coordinates..." HorizontalAlignment="Left"  Visibility="{Binding Path=IsNotUsedVisible, Mode=TwoWay}"/>
                                <sdk:Label Grid.Row="1" Grid.Column="0"   Content="Check partitioning..." HorizontalAlignment="Left"  Visibility="{Binding Path=IsNotUsedVisible, Mode=TwoWay}"/>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </ScrollViewer>
        </Grid>
        <StackPanel Grid.Row="2" Orientation="Horizontal" FlowDirection="RightToLeft">
            <Button Grid.Row="2" x:Name="ButtonCorrectRules" Content="Correct errors" Click="CorrectErrorsButton_Click"  Height="23" HorizontalAlignment="Right" Margin="0,0,10,0" />
        </StackPanel>
    </Grid>
</controls:ChildWindow>